﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="EditUser.aspx.cs" Inherits="App.Web.Views.App.Account.AccountAdmin.EditUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <% App.Account.Models.Forms.UserForm form = (App.Account.Models.Forms.UserForm)ViewData.Model; %>
    <h2>
        Edit User :
        <%= form.UserName %></h2>
    <h3>
        <%= Html.ActionLink<App.Account.Controllers.AccountAdminController>(c=>c.Users(null),"<< Return to Listing") %></h3>
    <% using (Html.BeginForm<App.Account.Controllers.AccountAdminController>(c => c.EditUser(form.UserID)))
       { %>
    <fieldset>
        <legend>Edit User</legend>
        <br class="clear" />
        <span class="message">
            <%=TempData["Message"] %>
        </span>
        <%= Html.ValidationSummary() %>
        <div>
            <br class="clear" />
            <label>
                <strong>ID</strong></label>
            <div>
                <%= form.UserID %></div>
            <%= Html.Hidden("UserID", form.UserID) %>
        </div>
        <br class="clear" />
        <div>
            <label>
                <strong>Name</strong></label>
            <div>
                <%= Html.TextBox("UserName", form.UserName)%></div>
        </div>
        <br class="clear" />
        <div>
            <label>
                <strong>E-mail</strong></label>
            <div>
                <%= Html.TextBox("Email", form.Email)%></div>
        </div>
        <br class="clear" />
        <div>
            <label>
                <strong>Password</strong></label>
            <div>
                <%= Html.TextBox("Password", form.Password)%></div>
        </div>
        <br class="clear" />
        <div>
            <label>
                <strong>Roles</strong></label>
            <div>
                <%= Html.ListBox("Roles", new MultiSelectList((App.Account.Models.Role[])ViewData["AllRoles"], "ID", "Name", form.Roles.ToArray()))%></div>
        </div>
        <br class="clear" />
        <div>
            <%= Html.SubmitButton("submit","Save Changes") %></div>
    </fieldset>
    <% } %>
</asp:Content>
